model button: Document iconic layout
authorMatthias Clasen <mclasen@redhat.com>
Wed, 16 Dec 2015 16:37:49 +0000 (11:37 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 16 Dec 2015 16:37:49 +0000 (11:37 -0500)
Document how the CSS nodes look if iconic is TRUE. Add
a .model style class for this case and use it in Adwaita.

gtk/gtkmodelbutton.c
gtk/theme/Adwaita/_common.scss
gtk/theme/Adwaita/gtk-contained-dark.css
gtk/theme/Adwaita/gtk-contained.css

index 727ea67f6ce415cf017cad0829150bb2cc2e844b..f536afe54dc6810e1cac7f2e96290810778b7a6a 100644 (file)
  *
  * The subnode is positioned before or after the content nodes and gets the
  * .left or .right style class, depending on where it is located.
+ *
+ * |[<!-- language="plain" -->
+ * button.model
+ * ├── <child>
+ * ╰── check
+ * ]|
+ *
+ * Iconic model buttons (see #GtkModelButton::iconic) change the name of
+ * their main node to button and add a .model style class to it. The indicator
+ * subnode is invisible in this case.
  */
 
 struct _GtkModelButton
@@ -435,6 +445,7 @@ gtk_model_button_set_iconic (GtkModelButton *button,
   if (iconic)
     {
       gtk_css_node_set_name (widget_node, I_("button"));
+      gtk_css_gadget_add_class (button->gadget, "model");
       gtk_css_gadget_add_class (button->gadget, "image-button");
       gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NORMAL);
       gtk_css_node_set_visible (indicator_node, FALSE);
@@ -442,6 +453,7 @@ gtk_model_button_set_iconic (GtkModelButton *button,
   else
     {
       gtk_css_node_set_name (widget_node, I_("modelbutton"));
+      gtk_css_gadget_remove_class (button->gadget, "model");
       gtk_css_gadget_remove_class (button->gadget, "image-button");
       gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
       gtk_css_node_set_visible (indicator_node,
index 94fadadd316b9c1672011092122c0bb2cd31f8c8..34c610185407770a174b8d85c594c224d0bfb7c8 100644 (file)
@@ -1561,7 +1561,7 @@ popover.background {
     transition: none;
   }
 
-  button.image-button {
+  button.model.image-button {
     padding: 0px;
   }
 
index 840f19e118311c712657ec5e9d533b61a9439f17..e60a047bdad693b1dcf1e67a010a8e6e24b43676 100644 (file)
@@ -2174,9 +2174,9 @@ popover.background {
   .titlebar popover.background button.titlebutton:hover {
     text-shadow: none;
     transition: none; }
-  popover.background button.image-button, popover.background headerbar button.titlebutton, headerbar popover.background button.titlebutton,
-  popover.background .titlebar button.titlebutton,
-  .titlebar popover.background button.titlebutton {
+  popover.background button.model.image-button, popover.background headerbar button.model.titlebutton, headerbar popover.background button.model.titlebutton,
+  popover.background .titlebar button.model.titlebutton,
+  .titlebar popover.background button.model.titlebutton {
     padding: 0px; }
   .csd popover.background.touch-selection, .csd popover.background.magnifier, popover.background.touch-selection, popover.background.magnifier {
     border: 1px solid rgba(255, 255, 255, 0.1); }
index d50b5d9aa986ac6ed91e6d7904ee11811f09b96e..d9d59727a930300066c76856b39361d166230313 100644 (file)
@@ -2180,9 +2180,9 @@ popover.background {
   .titlebar popover.background button.titlebutton:hover {
     text-shadow: none;
     transition: none; }
-  popover.background button.image-button, popover.background headerbar button.titlebutton, headerbar popover.background button.titlebutton,
-  popover.background .titlebar button.titlebutton,
-  .titlebar popover.background button.titlebutton {
+  popover.background button.model.image-button, popover.background headerbar button.model.titlebutton, headerbar popover.background button.model.titlebutton,
+  popover.background .titlebar button.model.titlebutton,
+  .titlebar popover.background button.model.titlebutton {
     padding: 0px; }
   .csd popover.background.touch-selection, .csd popover.background.magnifier, popover.background.touch-selection, popover.background.magnifier {
     border: 1px solid rgba(255, 255, 255, 0.1); }